/*
 * Copyright (c) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef OLA_REGISTER_H
#define OLA_REGISTER_H

#ifdef __cplusplus
extern "C" {
#endif

/*
 * 功能: 设备注册登录流程
 * 返回: OLA_OK，注册登录成功
 *       OLA_STATE_RUNING，登录成功进行中，需要持续调用该函数
 *       OLA_ERROR，登录成功失败
 * 注意: 该状态机不涉及动态资源分配，可随时退出
 */
int OlaRegisterProcess(void);

/*
 * 功能: 设备注册流程
 */
void OlaRegisterInit(void);

/*
 * 功能: 设置配网时云端提供的注册码到注册模块
 * 返回: OLA_OK，设置成功
 *       OLA_ERROR，设置失败
 */
int OlaRegisterSetRegistryCode(const unsigned char *registryCode);
#ifdef __cplusplus
}
#endif

#endif /* OLA_REGISTER_H */